1. Field of the Invention
The present invention generally relates to memory access operations and, more specifically, to a technique for accessing content-addressable memory.
2. Description of the Related Art
A conventional cache memory unit operates in conjunction with a tag unit that maintains virtual address tags associated with data currently residing within the cache memory unit. When processing a memory access request, the tag unit queries one or more content addressable memory units (CAMs) that store these virtual address tags in order to determine whether one of the CAMs includes a virtual address tag associated with the memory access request. Each CAM typically corresponds to a “set” within the cache memory unit. When a given CAM includes the virtual address tag, data associated with that tag resides within a corresponding set within the cache memory (i.e. a cache hit occurs). When a given CAM does not include the virtual address tag, data associated with that tag does not reside within the cache memory at all (i.e. a cache miss occurs).
The tag unit typically employs a particular set hashing function that determines a particular set based on the virtual address tag. Upon determining the particular set, the tag unit may then query the corresponding CAM in the fashion described above and determine whether a cache hit or a cache miss occurred. Typical set hashing functions are closely tied to the expected usage pattern of the cache memory unit. For example, a conventional set hashing function could compute the set for a given virtual address based on an index portion of the virtual address. This approach is sufficient for usage patterns where sequential memory accesses include different index portions, because in such a case, sequential CAM accesses would be distributed across different CAMs.
However, some usage patterns involve non-sequential memory access where the tag portion of each memory access in the sequence changes, yet the index portion remains the same. In these situations, the conventional set hashing function described above identifies just one CAM repeatedly. Consequently, that one CAM may become overloaded with multiple queries, thereby decreasing the speed with which the tag unit is capable of operating. Further, this approach allows the remaining CAMs to be underused, and, thus, does not utilize tag unit resources effectively.
Accordingly, what is needed in the art is a more effective technique for accessing CAM units.